/**
 * Created by Administrator on 2015/12/23.
 */
/**
 * Created by Administrator on 2015/12/3.
 */
define("wangwu/ceshi/test",
    [
        'dojo/_base/declare',
        'dojo/_base/lang',
        'dojo/on',
        'dojo/dom-construct',
        'dojo/query',

        'esri/layers/GraphicsLayer',

        'd3/d3'

    ],function(declare,lang, on,domConstruct,djQuery,
               GraphicsLayer,
               D3){
        var d = declare(null,{
            constructor:function(map,opt){
                this.map = map;
                this.option = {
                    layerid01:""
                };
                (opt)?lang.mixin(this.option,opt):0;

                this.initialized = false;

                this.buttonId = 'testDojo-'+parseInt(Math.random()*1000);
                domConstruct.create('div', {
                    'id':'aaaa1111',
                    'style':'position:absolute;right:70px;top:50px;width:100px',
                    'innerHTML':'<input type="button" value="test" id="'+this.buttonId+'"/>'
                }, map.id);
                var button = djQuery('#'+this.buttonId);
                on(button, 'click', lang.hitch(this, this.test));

                this.buttonId01 = 'testDojo01-'+parseInt(Math.random()*1000);
                domConstruct.create('div', {
                    'id':'aaaa2222',
                    'style':'position:absolute;right:20px;top:50px;width:100px',
                    'innerHTML':'<input type="button" value="清除" id="'+this.buttonId01+'"/>'
                }, map.id);
                var button01 = djQuery('#'+this.buttonId01);
                on(button01, 'click', lang.hitch(this, this.clear));

            },
            //-----------------------public----------------------------
            init:function(){
                if (this.initialized) return;
                this.initialized = true;
                this._init();
            },


            test:function(){
                console.log(this.option.layerid01);
            },

        });
        return d;
    })